package com.knowledge.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 消息表
 * </p>
 *
 * @author zzz
 * @since 2022-03-03
 */
@TableName("ms_news")
public class NewsEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 自增长编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 发送者用户ID
     */
    @TableField("from_user_id")
    private Long fromUserId;

    /**
     * 消息内容
     */
    @TableField("content")
    private String content;

    /**
     * 消息类型：1-分享消息
     */
    @TableField("`type`")
    private Integer type;

    /**
     * 扩展参数（JSON字符串）
     */
    @TableField("extend_params")
    private String extendParams;

    /**
     * 是否已读,0否，1是
     */
    @TableField("is_read")
    private Integer isRead;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getFromUserId() {
        return fromUserId;
    }

    public void setFromUserId(Long fromUserId) {
        this.fromUserId = fromUserId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
    public String getExtendParams() {
        return extendParams;
    }

    public void setExtendParams(String extendParams) {
        this.extendParams = extendParams;
    }
    public Integer getIsRead() {
        return isRead;
    }

    public void setIsRead(Integer isRead) {
        this.isRead = isRead;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "NewsEntity{" +
            "id=" + id +
            ", userId=" + userId +
            ", fromUserId=" + fromUserId +
            ", content=" + content +
            ", type=" + type +
            ", extendParams=" + extendParams +
            ", isRead=" + isRead +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
        "}";
    }
}
